<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <canvas id="canvas" width="800" height="800"></canvas>

  <script>
    const canvasDom = document.getElementById('canvas')
    const drawer = canvasDom.getContext('2d')

    // 绘制
    drawer.beginPath()
    // 第一个点
    drawer.moveTo(200, 300);
    drawer.quadraticCurveTo(150, 300, 150, 200);
    drawer.quadraticCurveTo(150, 100, 300, 100);
    drawer.quadraticCurveTo(450, 100, 450, 200);
    drawer.quadraticCurveTo(450, 300, 250, 300);
    drawer.quadraticCurveTo(250, 350, 150, 350);
    drawer.quadraticCurveTo(200, 300, 200, 300);
    drawer.stroke()
    drawer.closePath()
  </script>
</body>

</html>